Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.3 KB

Semi-automatic parametrization.rst

File metadata and controls

54 lines (36 loc) · 2.3 KB

Semi-automatic parametrization

The :class:`qsketchmetric.semiautomatic.SemiAutomaticParameterization` module is used to semi-automatic parameterize a DXF file. By semi-automatic, it means that the user has to manually customize the parameters of each entity after the automatic parameterization process. Process includes:

  • Adding :ref:`MTEXT` entity.
  • Adding :ref:`VIRTUAL_LAYER` layer.
  • Adding default expression to each entity.
  • Joining entities with virtual lines in to the one coherent graph.
  1. Make sure entities that are not :ref:`explicitly supported <explicit-section>` are packed in to an INSERT entity (block). If not, pack them using QCAD Professional software. Otherwise, the entities will be deleted during the semi-automatic parametrization process.

  2. If don't have already fire up a terminal and run python console:

    $ python
    
  3. Define the path to the DXF file to parametrize:

    input_dxf_file = 'path/to/dxf/file.dxf'
    
  4. (Optional) Define the path to the output parametrized DXF file.

    Default is input_dxf_file with _param appended to the file name contained in the parametric directory:

    output_dxf = 'path/to/output/parametrized_dxf/file.dxf'
    
  5. (Optional) Define the expression that will be used to parametrize each entity. Default is c which

    stand for current length. See allowed expressions on the :ref:`manual parametrization page <parametrization-section>`.:

    expression = '?'
    
  6. Parametrize the DXF file:

    from qsketchmetric.semiautomatic import SemiAutomaticParameterization
    
    input_dxf_file = 'path/to/dxf/file.dxf'
    
    # Optional
    output_dxf = 'path/to/output/parametrized_dxf/file.dxf'
    expression = '?'
    
    sap = SemiAutomaticParameterization(input_dxf_file, default_value=expression, output_dxf_path=output_dxf)
    sap.parametrize()
    

7. Open the parametrized file in QCAD Professional, and customize the parameters. Same as in the :ref:`manual parametrization <parametrization-section>` process.

8. Validate the file. This can be done by using the QSketchMetric Validator. See :ref:`Validating a parameterized DXF file <validator>` for more information.